package org.judo.admin.identity;

import org.judo.propertyobject.PropertyObject;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;

public class AppUser extends PropertyObject 
{
	private String password ;
	private String state_prov ;
	private String title ;
	private String unit ;
	private Date adddate ;
	private String businessphone ;
	private int status ;
	private String street2 ;
	private String lastname ;
	private String division ;
	private int userid ;
	private String country ;
	private String street1 ;
	private String cellphone ;
	private String firstname ;
	private String username ;
	private String email ;
	private String zip ;
	private String location ;
	private String city ;

	private HashMap urls = new HashMap();
	private HashMap roles = new HashMap();
	
	public void defineSecureURL(String url)
	{
		urls.put(url,url);
	}
	
	public boolean canViewURL(String url)
	{
		Iterator urlList = urls.keySet().iterator();
		
		while (urlList.hasNext())
		{
			String allowedUrl = (String)urlList.next();
			
			if (url.startsWith(allowedUrl))
				return true;
		}
		
		return false;
	}
	
	public void addRole(String role)
	{
		roles.put(role,role);
	}
	
	public void setPassword(String password) 
	{
		this.password = password;
	}

	public String getPassword() 
	{
		return this.password;
	}

	public void setState_prov(String state_prov) 
	{
		this.state_prov = state_prov;
	}

	public String getState_prov() 
	{
		return this.state_prov;
	}

	public void setTitle(String title) 
	{
		this.title = title;
	}

	public String getTitle() 
	{
		return this.title;
	}

	public void setUnit(String unit) 
	{
		this.unit = unit;
	}

	public String getUnit() 
	{
		return this.unit;
	}

	public void setAdddate(Date adddate) 
	{
		this.adddate = adddate;
	}

	public Date getAdddate() 
	{
		return this.adddate;
	}

	public void setBusinessphone(String businessphone) 
	{
		this.businessphone = businessphone;
	}

	public String getBusinessphone() 
	{
		return this.businessphone;
	}

	public void setStatus(int status) 
	{
		this.status = status;
	}

	public int getStatus() 
	{
		return this.status;
	}

	public void setStreet2(String street2) 
	{
		this.street2 = street2;
	}

	public String getStreet2() 
	{
		return this.street2;
	}

	public void setLastname(String lastname) 
	{
		this.lastname = lastname;
	}

	public String getLastname() 
	{
		return this.lastname;
	}

	public void setDivision(String division) 
	{
		this.division = division;
	}

	public String getDivision() 
	{
		return this.division;
	}

	public void setUserid(int userid) 
	{
		this.userid = userid;
	}

	public int getUserid() 
	{
		return this.userid;
	}

	public void setCountry(String country) 
	{
		this.country = country;
	}

	public String getCountry() 
	{
		return this.country;
	}

	public void setStreet1(String street1) 
	{
		this.street1 = street1;
	}

	public String getStreet1() 
	{
		return this.street1;
	}

	public void setCellphone(String cellphone) 
	{
		this.cellphone = cellphone;
	}

	public String getCellphone() 
	{
		return this.cellphone;
	}

	public void setFirstname(String firstname) 
	{
		this.firstname = firstname;
	}

	public String getFirstname() 
	{
		return this.firstname;
	}

	public void setUsername(String username) 
	{
		this.username = username;
	}

	public String getUsername() 
	{
		return this.username;
	}

	public void setEmail(String email) 
	{
		this.email = email;
	}

	public String getEmail() 
	{
		return this.email;
	}

	public void setZip(String zip) 
	{
		this.zip = zip;
	}

	public String getZip() 
	{
		return this.zip;
	}

	public void setLocation(String location) 
	{
		this.location = location;
	}

	public String getLocation() 
	{
		return this.location;
	}

	public void setCity(String city) 
	{
		this.city = city;
	}

	public String getCity() 
	{
		return this.city;
	}
}
